const app = getApp()
const amapFile = require('../../libs/amap-wx')

Page({
    data:{
        markers:[],
        longitude:113,
        latitude:35,
        myAmapFun:null
    },
    switchMap(){
        wx.redirectTo({
            url: '/pages/items/index'
        })
    },
    onLoad(){
        this.setData({
            myAmapFun:new amapFile.AMapWX({key:'1bf7233ac6e789c1f88df7c93ea45c6a'})
        })
        wx.getLocation({
            type:'gcj02',
            success:res=>{
                console.log(res)
                this.setData({
                    longitude:res.longitude,
                    latitude:res.latitude
                })
            }
        })
        app.axios('/project','GET',response=>{
            if (response){
                console.log(response)
                this.setData({
                    markers:[...response]
                })
            }
        })
    },
    showArea(){

    }
})
